<% layout('/layouts/default.html', {title: '活动管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(taskActivity.isNewRecord ? '新增活动' : '编辑活动')}
			</div>
			<!--<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>-->
		</div>
		<#form:form id="inputForm" model="${taskActivity}" action="${ctx}/wxrobot/taskActivity/save" method="post" class="form-horizontal">
			<div class="box-body">
				<!--<div class="form-unit">${text('基本信息')}</div>-->
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('活动名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="name" maxlength="200" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('海报图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage" bizKey="${taskActivity.id}" bizType="taskActivity_image"
								uploadType="image"  imageMaxWidth="-1"  imageMaxHeight="-1" class="" readonly="false" returnPath="true" filePathInputId="poster" maxUploadNum="1"/>
								<#form:input name="poster" type="hidden" id="poster" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('邀请码前缀')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="prefixCode" maxlength="4" class="form-control" placeholder="用于区分活动消息"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('好友应答文本')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea rows="4"  path="friendsText" maxlength="1000" class="form-control" placeholder="请输入海报底部邀请码，以助力好友免费获取..."/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('好友应答图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage_friendsPic" bizKey="${taskActivity.id}" bizType="friendsPic_image"
								uploadType="image"  imageMaxWidth="-1"  imageMaxHeight="-1" class="" readonly="false" returnPath="true" filePathInputId="friendsPic" maxUploadNum="1"/>
								<#form:input name="friendsPic" type="hidden" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<!--<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('好友应答群邀请')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="friendsGroupInvitation" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>-->
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('正确邀请码应答文本')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea rows="4"  path="rightCodeText" maxlength="1000" class="form-control" placeholder="邀请码正确，成功助力好友，接下来生成您的专属海报，邀请X个好友助力即可免费获取..."/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('正确邀请码应答图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage_rightCodePic" bizKey="${taskActivity.id}" bizType="rightCodePic_image"
								uploadType="image"  imageMaxWidth="-1"  imageMaxHeight="-1" class="" readonly="false" returnPath="true" filePathInputId="rightCodePic" maxUploadNum="1"/>
								<#form:input name="rightCodePic" type="hidden" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<!--<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('正确邀请码应答群邀请')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="rightCodeGroupInvitation" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>-->
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('错误邀请码应答文本')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea rows="4"  path="errorCodeText" maxlength="1000" class="form-control" placeholder="邀请码错误，请输入海报底部邀请码"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('错误邀请码应答图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage_errorCodePic" bizKey="${taskActivity.id}" bizType="errorCodePic_image"
								uploadType="image"  imageMaxWidth="-1"  imageMaxHeight="-1" class="" readonly="false" returnPath="true" filePathInputId="errorCodePic" maxUploadNum="1"/>
								<#form:input name="errorCodePic" type="hidden" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<!--<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('错误邀请码应答群邀请')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="errorCodeGroupInvitation" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>-->

				<div class="row">

					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('助力人数')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="helps" maxlength="4" class="form-control digits"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('助力成功应答文本')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea rows="4"  path="helpsArrivalText" maxlength="1000" class="form-control" placeholder="助力成功，您可免费获取...，请联系微信'shandenabian041733'领取"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('助力成功应答图片')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:fileupload id="uploadImage_helpsArrivalPic" bizKey="${taskActivity.id}" bizType="helpsArrivalPic_image"
								uploadType="image"  imageMaxWidth="-1"  imageMaxHeight="-1" class="" readonly="false" returnPath="true" filePathInputId="helpsArrivalPic" maxUploadNum="1"/>
								<#form:input name="helpsArrivalPic" type="hidden" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<!--<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('助力成功应答群邀请')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="helpsArrivalGroupInvitation" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>-->
				<!--<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
							</div>
						</div>
					</div>
				</div>-->
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-12">
						<% if (hasPermi('wxrobot:taskActivity:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<!--<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					-->
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>